package com.itheima.web;

import com.itheima.dto.SetmealDto;
import com.itheima.service.SetmealService;
import com.itheima.support.PageResult;
import com.itheima.support.QueryPageBean;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/setmeal")
public class SetmealController {

    @DubboReference
    private SetmealService setmealService;

    @PostMapping("/save")
    public boolean save(@RequestBody SetmealDto setmealDto){
        return setmealService.saveSetmeal(setmealDto);
    }

    @PostMapping("/findByPage")
    public PageResult findByPage(@RequestBody QueryPageBean queryPageBean){
        return setmealService.findByPage(queryPageBean);
    }

    @GetMapping("/clearOssPic")
    public void clearOssPic(){
        setmealService.clearOssPic();
    }

}
